package com.zjh;

import com.zjh.bean.Student;
import com.zjh.dao.StudentDao2;
import com.zjh.util.sqlSessionUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * @author LiZiQiu
 * @data 2023/3/8
 */
public class TestIn {
    public static void main(String[] args) {
        SqlSession session = sqlSessionUtil.getSession();
        StudentDao2 mapper = session.getMapper(StudentDao2.class);
//        List list = new ArrayList();
//        list.add(1);
//        list.add(3);
//        list.add(5);
//        list.add(10);
//        List<Student> students = mapper.finda(list);
//        int[] ids = new int[]{1,3,5,7,10};
//        List<Student> students = mapper.findb(ids);
        ArrayList list = new ArrayList();
        list.add(1);
        list.add(3);
        list.add(5);
        list.add(10);
        HashMap map = new HashMap();
        map.put("ids",list);
        List<Student> students = mapper.findc(map);
        for (Student student : students) {
            System.out.println(student);
        }
        sqlSessionUtil.closeSession();

    }
}
